//logs.js
const util = require('../../utils/util.js')
const app = getApp()
const english = require('../../utils/language/en.js')
const chinese = require('../../utils/language/zh_CN.js')
Page({
  data: {
    logs: []
  },
  onLoad: function () {
    this.setData({
      logs: (wx.getStorageSync('logs') || []).map(log => {
        return util.formatTime(new Date(log))
      })
    })
  },
  getLanguageContent: function (type) {
    if (type === 'en') {
      this.setData({
        content: english.content
      })
    } else {
      this.setData({
        content: chinese.content
      })
    }
  },
  onShow:function(){
    const languageType = app.globalData.language
    this.getLanguageContent(languageType)
  }
})
